//
//  H5Downloader.h
//  dsBridge
//
//  Created by sxh on 2020/9/21.
//

#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, FileStatus) {
    DownLoadStatusFailed    = 0,            //  下载失败
    DownLoadStatusIng       = 1 << 0,       //  下载中
//    DownLoadStatusSuccess   = 1 << 1,       //  下载成功
    UnZipStatusFailed       = 1 << 1,       //  下载成功且解压失败
    UnZipStatusSuccess      = 1 << 2,       //  下载成功且解压成功
};

///文件状态 - 下载进度 - 下载地址 - 文件解压地址
typedef void(^DownloadResultBlock)(FileStatus status, float progress, NSString * _Nullable downloadPath, NSString *_Nullable unzipPath);

NS_ASSUME_NONNULL_BEGIN

@interface SXHDownloader : NSObject

+ (instancetype)sharedInstace;

/**
    根据版本号来更新资源
 */
- (void)requestFileUrl:(NSString *)urlStr
            webVersion:(NSString *)webVersion
              complete:(DownloadResultBlock)complete;

@end

NS_ASSUME_NONNULL_END
